<?php
/**
 * 公共常量配置
 */

namespace App\Constants;


class BaseConstants
{
    const DATA_TRUE = 1;
    const DATA_FALSE = 2;
    const DEFAULT_PAGE_SIZE = 20;//默认分页数量


    const POINT_TO_YUAN = 0.1;

    const SMS_SEND_STATUS_INIT = 1;
    const SMS_SEND_STATUS_DONE = 2;
    const SMS_SEND_STATUS_ERROR = 3;

    const SMS_SEND_STATUS_MAP = [
        self::SMS_SEND_STATUS_INIT => '未确认',
        self::SMS_SEND_STATUS_DONE => '发送成功',
        self::SMS_SEND_STATUS_ERROR => '发送失败',
    ];
    const SMS_SEND_TYPE_VC = 1;

    const MERCHANT_STATUS_CLOSE = 0;
    const MERCHANT_STATUS_OPEN = 1;

    const MERCHANT_STATUS_MAP = [
        self::MERCHANT_STATUS_CLOSE => '关闭',
        self::MERCHANT_STATUS_OPEN => '开启',
    ];


    /**
     * 订单状态:
     *
     * 0待支付,
     * 1支付中,正在处理,
     * 2订单完成,
     * 3商家已退款,
     * 4系统已退款,
     * 5订单关闭
     */
    const ORDER_STATUS_INIT = 0;
    const ORDER_STATUS_PAY = 1;
    const ORDER_STATUS_DONE = 2;
    const ORDER_STATUS_REFUND = 3;
    const ORDER_STATUS_SYSTEM_REFUND = 4;
    const ORDER_STATUS_CLOSE = 5;
    const ORDER_STATUS_REFUND_ING = 6;


    const ORDER_STATUS_MAP = [
        self::ORDER_STATUS_INIT => '等待支付',
        self::ORDER_STATUS_PAY => '支付中,正在处理',
        self::ORDER_STATUS_DONE => '交易完成',
        self::ORDER_STATUS_REFUND => '商家已退款',
        self::ORDER_STATUS_SYSTEM_REFUND => '系统已退款',
        self::ORDER_STATUS_CLOSE => '订单关闭',
        self::ORDER_STATUS_REFUND_ING => '正在退款中'
    ];

    /**
     * @property int $change_type
     * 变化类型:0:消费获得,1消费支出,2储值获得,3退货获得, 4退货系统回收
     */
    const USER_POINT_CHANGE_LOG_TYPE_SALE_IN = 0;
    const USER_POINT_CHANGE_LOG_TYPE_SALE_OUT = 1;
    const USER_POINT_CHANGE_LOG_TYPE_RECHARGE_IN = 2;
    const USER_POINT_CHANGE_LOG_TYPE_REFUND_IN = 3;
    const USER_POINT_CHANGE_LOG_TYPE_REFUND_SYSTEM_ROLL_BACK = 4;

    const USER_POINT_CHANGE_LOG_TYPE_MAP = [
        self::USER_POINT_CHANGE_LOG_TYPE_SALE_IN => '消费获得',
        self::USER_POINT_CHANGE_LOG_TYPE_SALE_OUT => '消费支出',
        self::USER_POINT_CHANGE_LOG_TYPE_RECHARGE_IN => '储值获得',
        self::USER_POINT_CHANGE_LOG_TYPE_REFUND_IN => '系统退货退还',
        self::USER_POINT_CHANGE_LOG_TYPE_REFUND_SYSTEM_ROLL_BACK => '退货系统回收',
    ];

    const MERCHANT_POINT_CHANGE_LOG_TYPE_SALE_IN = 0;
    const MERCHANT_POINT_CHANGE_LOG_TYPE_REFUND_OUT = 1;
    const MERCHANT_POINT_CHANGE_LOG_TYPE_APPLY_CASH_OUT = 2;

    const MERCHANT_POINT_CHANGE_LOG_TYPE_MAP = [
        self::MERCHANT_POINT_CHANGE_LOG_TYPE_SALE_IN => '交易获得',
        self::MERCHANT_POINT_CHANGE_LOG_TYPE_REFUND_OUT => '退货支出',
        self::MERCHANT_POINT_CHANGE_LOG_TYPE_APPLY_CASH_OUT => '提现支出',
    ];


    const PAY_TYPE_POINT = 0;
    const PAY_TYPE_WECHAT = 1;
    const PAY_TYPE_WECHAT_POINT = 2;

    const PAY_TYPE_MAP = [
        self::PAY_TYPE_POINT => '积分支付',
        self::PAY_TYPE_WECHAT => '微信支付',
        self::PAY_TYPE_WECHAT_POINT => '微信+积分',
    ];

    const APPLY_STATUS_INIT = 0;//审核中
    const APPLY_STATUS_PAY_ING = 1;//待打款
    const APPLY_STATUS_PAY_DONE = 2;//已打款

    const APPLY_STATUS_MAP = [
        self::APPLY_STATUS_INIT => '审核中',
        self::APPLY_STATUS_PAY_ING => '待打款',
        self::APPLY_STATUS_PAY_DONE => '已打款',
    ];
}
